
//用户接口相关的函数
import request from "../untils/request.js"

/**
 * 
 * @param { post } data 
 *  
 */

// 新建采购入库
export const addPurchase = (data) => {
    return request.post("/outpatient/addPurchaseInventory", data)
}
// 修改西药采购入库
export const editPurchase = (data) => {
    return request.post("/outpatient/edit", data)
}
//新建结算清单
export const addSettlement = (data) => {
    return request.post("/outpatient/addSettlementApplication", data)
}

//新建药品库存
export const addDrugs = (data) => {
    return request.post("/outpatient/addServiceDrugs", data)
}

//新建药品库存
export const settlement = (data) => {
    return request.post("/outpatient/settlementExamine", data)
}
//采购退货
export const returnOfGoods = (data) => {
    return request.post("/outpatient/returnOfGoods", data)
}
// 新建一条采购计划
export const addPurchasingPlan = (data) => {
    return request.post("/outpatient/addPurchasingPlan", data)
}

// 修改采购计划
export const editPurchasingPlan = (data) => {
return request.post("/outpatient/editPurchasingPlan", data)
}
//新建采购入库
export const addDrugStorage = (data) => {
    return request.post("/outpatient/addDrugStorage", data)
}



// 提交审核过单 => 采购计划
export const toExamine = (data) => {
    return request.post("/outpatient/toExamine", data)
}
// 提交审核过单 => 采购退库
export const toRetnExamine = (data) => {
    return request.post("/outpatient/docOut/toRetnExamine", data)
}

// 提交审核过单 => 采购入库
export const toDrugExamine = (data) => {
    return request.post("/outpatient/toDrugExamine", data)
}


/**
 * 
 * @param { get } params 
 *  
 */
// 西药采购入库根据药品id获取厂家下拉选择框
export const getProdent = (params) => {
    return request.get("/outpatient/getWareCj", { params })
}


// 采购计划列表查询
export const getPurchasingPlan = (params) => {
    return request.get("/outpatient/getPurchasingPlan", { params })
}
// 获取采购计划
export const getPlans = (params) => {
    return request.get("/outpatient/getPlans", {params})
}
// 新建采购入库 = > 采购计划
export const getPlanData = (params) => {
    return request.get("/outpatient/getPlanData", {params})
}
// 采购入库列表
export const getDrugStorage = (params) => {
    return request.get("/outpatient/getDrugStorage", { params })
}	
// 用于新建计划采购选择药品
export const getWare = (params) => {
    return request.get("/outpatient/getWare", { params })
}
// 获取采购计划
export const getPlan = (params) => {
    return request.get("/outpatient/getPlan", { params })
}
// 获取采购入库
export const getDrugDetails = (params) => {
    return request.get("/outpatient/getDrugDetails", { params })
}
// 获取采购退库
export const getRetnList = (params) => {
    return request.get("/outpatient/docOut/getRetnList", { params })
}
// 获取厂家信息
export const getManufacturer = (params) => {
    return request.get("/outpatient/getManufacturer", { params })
}
// 采购入库模糊查询
export const selecting = () => {
    return request.get("/outpatient/selectStatusAndType")
    }
	
// 供应商列表
export const SupplierEntityList = (params) => {
    return request.get("/outpatient/selectSupplierEntityList", { params })
    }
// 获取药品加成率 => 中药
export const getDocMark = (params) => {
    return request.get("/outpatient/docMark/page", { params })
}
// 获取采购计划通过ID的详情
export const getPlanDrugDetails = (params) => {
    return request.get("/outpatient/getPlanDrugDetails", { params })
}	
	
// 供应商下拉列表
export const selectDropDownList = (params) => {
    return request.get("/outpatient/selectDropDownList", { params })
    }
	
// 采购入库列表
export const selectAll = (params) => {
    return request.get("/outpatient/selectAll", { params } )
    }	
	
// 采购其他入库列表
export const getOther = (params) => {
    return request.get("/outpatient/getOther", { params } )
}
	
// 申请人员工列表
export const selectInformation = (params) => {
    return request.get("/outpatient/selectInformation", { params } )
 }	
	
// 结算申请列表待条件的分页查询
export const StatusAndSupplier = (params) => {
    return request.get("/outpatient/selectByStatusAndSupplier", { params } )
    }	
	
// 通过药品名称,药品编码模糊查询
export const selectingDrugCode = (params) => {
    return request.get("/outpatient/selectDrugNameAndDrugCode", { params } )
}

// 西药药品明细流向
export const chgDetails = (params) => {
    return request.get("/outpatient/chgDetails/page", { params } )
}

// 通过供应商查询分页查询
export const selectSupplier = (params) => {
    return request.get("/outpatient/selectSupplier", { params } )
}

// 库存列表
export const DrugsList = (params) => {
    return request.get("/outpatient/selectDrugsWarehousingList", { params } )
}

// 药品编码模糊查询
// export const DrugsList = (params) => {
//     return request.get("/outpatient/selectDrugNameAndDrugCode", { params } )
// }

// 效期
export const DateRange = (params) => {
    return request.get("/outpatient/selectPurchaseInventoryByEffectiveDateRange", { params } )
}

// 过期
export const ExpireMedicine = (params) => {
    return request.get("/outpatient/selectExpireMedicine", { params } )
}
// 西药库效期统计接口
export const ExpireWarn = (params) => {
    return request.get("/outpatient/expireWarn", { params } )
}

/**
 * 
 * @param { DELETE } params 
 *  
 */  

// 西药采购计划草稿删除
export const deletePlanData = (params) => {
    return request.delete("/outpatient/deletePlanData", { params })
}
// 西药采购入库草稿删除
export const deleteBy = (params) => {
    return request.delete("/outpatient/deleteBy", { params })
}
// 西药房采购入库草稿删除
export const deleteDoc = (params) => {
    return request.delete("/outpatient/dugDoc/deleteDoc", { params })
}

// 暴露
export default{
	getProdent,
	getWare,getPlans,getPlanDrugDetails,deleteDoc,
	getPurchasingPlan,addPurchasingPlan,toExamine,addDrugStorage,getPlan,getPlanData,editPurchasingPlan,getManufacturer,getDrugDetails,toDrugExamine,getRetnList,
	toRetnExamine,
	addDrugs,selectInformation,
	returnOfGoods,
	selecting,
	selectingDrugCode,
	addPurchase,editPurchase,deleteBy,deletePlanData,
	DrugsList,
	selectAll,
	// selectStatusAndType,
	StatusAndSupplier,
	addSettlement,
	selectSupplier,
	SupplierEntityList,
	selectDropDownList,
	DateRange,
	ExpireMedicine,
	settlement,
	getDrugStorage,getDocMark,chgDetails,ExpireWarn,
	// 其他入库
	getOther,
}